<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="always" name="referrer">
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>用户名</title>
    <link rel="stylesheet" href="/LianniuWeb/css/seller/reset.css">
    <link rel="stylesheet" href="/LianniuWeb/css/seller/main_product.css">
    <link type="text/css" rel="stylesheet" href="/LianniuWeb/css/easydialog.css"/>
    <script type="text/javascript" src="/LianniuWeb/js/widget/easydialog.min.js"></script>

</head>
<body>
<div class="ranking_header">
    <div class="back_btn" onclick="window.location.href='/LianniuWeb/supply/personal/informationDetail.do'"></div>
    <p>修改用户名</p>
</div>
<div class="padding_both">
    <input type="text" name="" placeholder="请输入用户名" class="change_name" id="compName" maxlength="10">
    <input type="hidden" id="supplyId" value="">
    <input type="button" value="保存" class="load_btn" id="save">
</div>
<script src="/LianniuWeb/js/jquery/jquery-1.11.3.min.js"></script>
<script src="/LianniuWeb/js/underscore/underscore.js"></script>
<script src="/LianniuWeb/js/commons/commons.js"></script>
<script src="/LianniuWeb/js/commons/util.js"></script>
<script type="text/javascript" src="/LianniuWeb/js/buyer/flexible.js"></script>
<script >

    $(function(){
        $.ajax({
            url:server_url + '/rest/supply/personal/supplyinfo.do',
            data:{userId:userid},
            success:function(data){
                $("#compName").val(data.data.supplyname);
                $("#supplyId").val(data.data.supplyid);
            }
        });
        $("#save").click(function(){
            var compName = $("#compName").val();
            if(compName == null || compName == ''){
                easyAlert("请输入用户名");
                return;
            }
            $.ajax({
                url:server_url + '/rest/supply/personal/updateSupplyName.do',
                data:{supplyName:compName,supplyId:$("#supplyId").val()},
                success:function(){
                    easyAlert("更新成功");
                    window.location.href='/LianniuWeb/supply/personal/informationDetail.do';
                }
            })
        });
    })
</script>
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?867c800f411683d2a7fa9eb1eabd9736";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>
</html>